<?php if ( $errorMessage !== null || $errorMessage != '' ) {?>
<div class="error_message"><?= nl2br($errorMessage)?></div>
<?php } else {?>
<p> Cập nhật <?=$successCount;?> thành công.</p>
<p> <?=$failingCount;?> dữ liệu bị lỗi.</p>
<?php } ?>

<?php if ( count($categoryList) > 0 ) {?>
<table class="tb_general" id="tb_category">
    <tr>
        <th style="width: 2%;">Excel Row</th>
        <th>Danh Mục</th>
        <th>Hình Ảnh</th>
        <th>Danh Mục Cha</th>
        <th>Ngày Nhập</th>
    </tr>

    <tbody id="tbody_category">
        <?php
        foreach ( $categoryList as $excelRowIndex => $o_category) {
            $date_insert = new DateTime($o_category->insert);
        ?>
        <tr id="tr_<?=$o_category->key;?>">
            <td><?=$excelRowIndex;?></td>
            <td><?=$o_category->name;?></td>
            <td><?=$o_category->image;?></td>
            <td><?=CHtml::decode($o_category->parent_name);?></td>
            <td><?=$date_insert->format("Y-m-d");?></td>
        </tr>
        <?php }?>
    </tbody>
</table><!--End tb_general-->
<?php } ?>